<?php ob_start();?>
<?php
$root = $_SERVER['DOCUMENT_ROOT'];
include($root.'/standart/head.php');
include($root.'/standart/dateHeader.php');
include($root.'/standart/checkUser.php');
$db = connect();
$orderId = $_GET["order_id"];
$stmt ="SELECT ORDERS.ID,MENU.PRODUCT_NAME,MENU.UNIT,ORDER_ITEMS.PRICE 
,(ORDER_ITEMS.PRICE*ORDER_ITEMS.QUANTITY) AS TUTAR,ORDER_ITEMS.QUANTITY,ORDER_ITEMS.ITEM_NOTE
		FROM ORDERS 
		LEFT OUTER JOIN ORDER_ITEMS ON 
		ORDERS.ID=ORDER_ITEMS.ORDER_ID 
		LEFT OUTER JOIN MENU ON 
		ORDER_ITEMS.MENU_ID=MENU.ID 
		WHERE CANCEL = 0 AND ORDERS.ID='$orderId';";
$res = $db->query($stmt) or die($stmt."<br/><br/>".mysql_error());
	?>
	<table class="table table-striped table-bordered table-hover" id="dataTables-example_2">
		<thead>
        	<tr>
        		<th style="display:none;">Sipariş No</th>
                <th>Ürün İsmi</th>
				<th>Sipariş Notu</th>
                <th>Birim Fiyatı</th>
                <th>Sipariş Miktarı</th>
				<th>Birim</th>
                <th>Tutar</th>
            </tr>
		</thead>
        <tbody>
        <?php $odd = true; ?>
       	<?php while($row = $res->fetch_assoc()){?>
        	<tr class="<?php echo $odd ? "odd" : "even";?> " style="cursor: pointer;">
	            <td style="display:none;"><?php echo $row["ID"];?></td>
	            <td><?php echo $row["PRODUCT_NAME"];?></td>
	            <td><?php echo $row["ITEM_NOTE"];?></td>
                <td style="text-align: right;"><?php echo $row["PRICE"];  ECHO ' TL';?></td>
                <td style="text-align: right;"><?php echo $row["QUANTITY"];?></td>
                <td><?php echo $row["UNIT"];?></td>
                <td style="text-align: right;"><?php echo number_format($row["TUTAR"], 2); ECHO ' TL';?></td>
			</tr>
			<?php $odd = !$odd;?>
		<?php }?>
		<?php if(isset($_GET['report'])){?>
		<?php }?>
		</tbody>
     </table>
	<?php 
$res->close();
disconnect($db);
?>
<?php ob_end_flush(); ?>